//package com.zy.teacher.controller.front;
//
//import cn.eduxueyuan.common.R;
//import cn.eduxueyuan.eduservice.entity.EduCourse;
//import cn.eduxueyuan.eduservice.entity.EduTeacher;
//import cn.eduxueyuan.eduservice.service.EduCourseService;
//import cn.eduxueyuan.eduservice.service.EduTeacherService;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
//@RestController
//@RequestMapping("/eduservice/frontteacher")
//@CrossOrigin
//public class FrontTeacherController {
//
//    @Autowired
//    private EduTeacherService teacherService;
//
//    @Autowired
//    private EduCourseService courseService;
//
//    //讲师列表分页功能
//    @GetMapping("findAllTeacherFront/{page}/{limit}")
//    public R getAllTeacherFront(@PathVariable Long page,
//                                @PathVariable Long limit) {
//        //1 创建Page对象
//        Page<EduTeacher> pageTeacher = new Page<>(page,limit);
//        //调用service的方法实现分页
//        //把分页所用数据封装到map集合，返回map集合
//        Map<String,Object> map = teacherService.getTeacherAllFront(pageTeacher);
//
//        return R.ok().data(map);
//    }
//
//    //根据讲师id查询讲师详情信息
//    @GetMapping("getFrontTeacherInfo/{id}")
//    public R getFrontTeacherInfo(@PathVariable String id) {
//        //1 根据讲师id查询讲师基本信息
//        EduTeacher teacherInfo = teacherService.getById(id);
//
//        //2 根据讲师id查询讲师所讲课程
//        List<EduCourse> courseList = courseService.getCourseListTeacherId(id);
//
//        return R.ok().data("teacherInfo",teacherInfo).data("courseList",courseList);
//    }
//}
